﻿using System.Net;
using SocketCore.Decoder;
using SocketCore.Encoder;
using System.Collections.Generic;

namespace SocketCore.Network
{
    public interface ISocketService
    {
        // Methods
        void Bind(EndPoint endPoint, INetworkHandler handler);
        void Bind(EndPoint endPoint, NetworkHandlerChain networkHandlerChain);
        bool CheckDos(IoSession session);
        void DisConnect(IoSession session);
        byte[] GetDatagram(Message message, IoSession session);
        void NotifyError(IoSession session, System.Exception exception);
        void OnMessageReceived(object state);
        void Send(IoSession session, byte[] message);
        void Send(IEnumerable<IoSession> session, Message message);
        void Send(IoSession session, Message message);
        void UnBind(EndPoint endPoint);
        void UnBindAll();

        // Properties
        IMessageDecoder Decoder { get; set; }
        IMessageEncoder Encoder { get; set; }
        NetworkHandlerChain NetworkHandlerChain { get; set; }
    }

 

}
